package com.purang.andfix2;

import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import java.io.File;

public class MainActivity extends AppCompatActivity {

    private Calculator mCalculator;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mCalculator = new Calculator();


//        getApplicationContext().getExternalFilesDir("imdownpics").getAbsolutePath();

        String absolutePath = getApplicationContext().getExternalCacheDir().getAbsolutePath();
        String path = getApplicationContext().getExternalCacheDir().getPath();
        File cacheDir = getApplicationContext().getCacheDir();


        Log.d(">>", "onCreate: absolutePath:" + absolutePath + "\npath:" + path + "\ncacheDir:" + cacheDir);

    }

    public void calculator(View view) {
        mCalculator.calculator(this);
    }

    public void fix(View view) {
//        String dexPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/out.dex";
        DexManager.getInstance().setContext(getApplicationContext());
        DexManager.getInstance().fix(new File(Environment.getExternalStorageDirectory(), "out.dex"));

    }
}
